package com.yhf.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@RequestMapping("")
public class UserController {
    @RequestMapping("test")
    public String geruser(){
        return "123";
    }

    @RequestMapping("user/login")
    public String login(){
        return "login";
    }
    @RequestMapping("add")
    public String add(){
        return "add";
    }

    @RequestMapping("delete")
    @PreAuthorize("hasRole('ROLE_teacher')")//方法执行前控制，@PostAuthorize("hasRole('ROLE_teacher')")方法执行后控制
    public String delete(){
        return "delete";
    }

}
